package com.wenyl.juc.thread.CycliBarrierTest;

import java.util.concurrent.CyclicBarrier;

/**
 * @author Swimming Dragon
 * @description: TODO
 * @date 2024年11月07日 11:02
 */
public class Test {
    public static void main(String[] args) {
        TimeCount tc = new TimeCount();
        CyclicBarrier cb = new CyclicBarrier(2, () -> {
            int sum = tc.getSum();
            System.out.println("功能总耗时"+sum+"ms");
        });
        new Thread(new UserRun1("爬虫功能",tc,cb)).start();
        new Thread(new UserRun1("发送邮件",tc,cb)).start();
    }
}
